<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('username',50)->default('')->comment('用户名');
            $table->string('open_id',200)->default('')->comment('会员');
            $table->string('phone',20)->default('')->unique()->comment('手机号');
            $table->string('email',20)->default('')->unique()->comment('邮箱');
            $table->string('avatar')->default('/images/avatar/default.jpg')->comment('头像');
            $table->string('last_ip',100)->default('0.0.0.0')->comment('最后一次登录的IP');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
